export default {
  formatQian(num, unit ){
    if(isNaN(num) || num === null || num === undefined) return '';
    num = parseFloat(num)
    const isZheng = num % 1 === 0;
    num = isZheng ? num.toFixed(0) : num.toFixed(2);
    let parts = num.split('.');
    let integerPart = parts[0];
    let decimalPart = parts[1];
    let formattedIntegerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
    if(isZheng) {
      return formattedIntegerPart + unit;
    }
    return formattedIntegerPart + '.' + decimalPart + unit;
  }
}